import type { orderStatusValues } from '@/lib/db/schema/enum';
import type { getOrderById, listShopOrdersByPage } from '../query/order';

export type OrderSummary = NonNullable<
  Awaited<ReturnType<typeof listShopOrdersByPage>>['result']
>['data'][0];

export type Order = NonNullable<
  Awaited<ReturnType<typeof getOrderById>>['result']
>;

export const orderStatusMap: Record<
  (typeof orderStatusValues)[number],
  string
> = {
  unpaid: '未支付',
  unaccepted: '未接单',
  pending: '待配送',
  delivering: '配送中',
  completed: '已完成',
  canceled: '已取消',
};
